# name : proc lifetest for unstratified logrank stat
# key : lifetest.logrank.stat.unstratified
# key : logrank.stat.unstratified
# contributor: Shuguang Sun
# --
ods select quartiles means homstats homtests survdiff logunichisq survivalplot censoredsummary;
ods output lifetest.stratum1.productlimitestimates = $5_prodest1;
ods output lifetest.stratum2.productlimitestimates = $5_prodest2;
ods output homtests=${5:km}_testp;
ods output HomStats=$5_stat LogrankHomCov=$5_cov;
* only for non-stratified analysis;
ods output logunichisq = $5_lgrk;
ods output quartiles = $5_quart;
proc lifetest data = ${1:dtin}
method = km alpha = 0.05 alphaqt = 0.05 conftype = linear
timelist = 12 reduceout outsurv=os
plots = survival(atrisk=0,8,12 test);
time ${2:aval} * ${3:cnsr} (1);
strata ${4:trt01pn} / test=(logrank wilcoxon lr) diff;
test $4;
run;
